/**
 * @date 4:16:47 PM
 * EducationSchoolController.java
 * Administrator
 * TODO
 */
package com.qs.education.controller;

import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.qs.education.bean.api.ResponseBean;
import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationSchoolBean;
import com.qs.education.bean.entity.EducationSchool;
import com.qs.education.service.ISchoolAPPService;
/**
 * @class EducationSchoolController	
 * @author Warren
 * @description
 * @date Nov 7, 2018 
 */
@RestController
public class EducationSchoolController {
	@Autowired
	private ISchoolAPPService iSchoolAPPService;
	private final Logger log = Logger.getLogger(this.getClass());
	
	/**
	 * @author Warren
	 * @return Map<String,Object>
	 * @description 获得所有学校
	 * @date Nov 8, 2018
	 */
	@RequestMapping("/school/getList")
	public Map<String, Object> getList() {
		log.info("api");
		ResponseListBean<EducationSchoolBean> responselistBean = iSchoolAPPService.getList();	
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("responselistBean", responselistBean);
		return map;
	} 
	
	/**
	 * @author Warren
	 * @param educationSchool
	 * @return Map<String,Object>
	 * @description 根据省市区选择所有学校
	 * @date Nov 8, 2018
	 */
	@RequestMapping("/school/getListByProvinceAndCityAndArea")
	public Map<String,Object> getListByProvinceAndCityAndArea(@RequestBody EducationSchool educationSchool){
		log.info("api");
		ResponseListBean<EducationSchoolBean> responselistBean = iSchoolAPPService.getListByProvinceAndCityAndArea(educationSchool);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("responselistBean", responselistBean);
		return map;
	}
	
	/**
	 * @author Warren
	 * @param id 学生id
	 * @param schoolId 学校id
	 * @return Map<String,Object>
	 * @description
	 * @date Nov 8, 2018
	 */
	@RequestMapping("/school/selectSchool")
	public Map<String,Object> selectSchool(Long id,Long schoolId){
		log.info("api");
		ResponseBean ResponseBean = iSchoolAPPService.selectSchool(id,schoolId);	
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("ResponseBean", ResponseBean);
		return map;
	}
}
